﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AppLab.Core
{
    public abstract class LogListener : IDisposable
    {
        protected bool disposed = false;

        ~LogListener()
        {
            Dispose(false);
        }

        public abstract void WriteLine(string level, string format);
        public virtual void Flush()
        { 
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing)
        {     
        }

        protected virtual void Close()
        { 
        }
    }
}
